namespace InfoLogic.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class soffo2 : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.Sales",
                c => new
                    {
                        SalesId = c.Guid(nullable: false),
                        DateOfSale = c.DateTime(nullable: false),
                        productId = c.Guid(nullable: false),
                        userId = c.String(),
                    })
                .PrimaryKey(t => t.SalesId);
            
            AddColumn("dbo.Product", "Sales_SalesId", c => c.Guid());
            AddForeignKey("dbo.Product", "Sales_SalesId", "dbo.Sales", "SalesId");
            CreateIndex("dbo.Product", "Sales_SalesId");
        }
        
        public override void Down()
        {
            DropIndex("dbo.Product", new[] { "Sales_SalesId" });
            DropForeignKey("dbo.Product", "Sales_SalesId", "dbo.Sales");
            DropColumn("dbo.Product", "Sales_SalesId");
            DropTable("dbo.Sales");
        }
    }
}
